﻿using System.ComponentModel.DataAnnotations;
using Shop.Core.Consts;

namespace Shop.Model.Dto;

public class BaseDto
{
    /// <summary>
    /// 语言(zh:中文，ULY:维语)
    /// </summary>
    public string Language { get; set; }
    
    /// <summary>
    /// 是否中文
    /// </summary>
    /// <returns></returns>
    public bool IsZh()
    {
        return this.Language.Equals(LanguageConsts.ZH);
    }
}

public class BaseDto<T>
{
    /// <summary>
    /// 语言(zh:中文，ULY:维语)
    /// </summary>
    public string Language { get; set; }
    
    /// <summary>
    /// 是否中文
    /// </summary>
    /// <returns></returns>
    public bool IsZh()
    {
        return this.Language.Equals(LanguageConsts.ZH);
    }
    
    /// <summary>
    /// 
    /// </summary>
    [Required]
    public T Value { get; set; }
}